
var checkactivity = function(callback) {
    var link = buildUrl('json','photoShare','check',$.util.getParam("customerId"), {
        actId: $.util.getParamByObject("actId")
    })
    $.ajax({
        url: link,
        type: "GET",
        dataType: "json",
        beforeSend: function() {
            layer.open({ type: 2 });
        },
        success: function(data) {
            if (data.code == 1) {
                callback();
            } else {
                layer.closeAll();
                layer.open({
                    content: data.info
                })
            }
        }
    })
}

var needInfo = function(img1, img2, img3 , callback) {
    layer.open({
        type: 1,
        content: '<a class="close-btn"><img src="'+img3+'" /></a>'
                 +'<div class="promptpic">'
                     +'<img src="' + img1 + '">'
                 +'</div>'
                 +'<form class="inputlist">'
                     +'<input name="username" type="text" placeholder="请输入姓名" class="name">'
                     +'<input name="tel" type="tel" placeholder="请输入手机号" class="phone">'
                     +'<div id="submit_save">'
                         +'<img src="' + img2 + '">'
                     +'</div>'
                 +'</form>',
        style: 'max-width:90%;padding:5%'
    });
    $('#submit_save').on('click', function() {
        var data = formartFormData('.inputlist');
        callback(data);
    })

    $('.close-btn').on('click',function(){
        layer.closeAll();
    })


}

var uploadImage = function(callback) {
    wx_share.uploadMultImage(callback);
}

var checkPartake = function(value) {
    var showlink = buildUrl("html", "photoShare", "show", $.util.getParam("customerId"), {
        actId: $.util.getParamByObject("actId"),
        chanelId: $.util.getParamByObject("chanelId"),
        partake_id: value
    })
    if (value) {
        window.location.href=showlink;
    }
}

$(function() {
    $('[data-bk]').each(function() {
        var u = $(this).attr('data-bk');
        console.log(u)
        $(this).css({
            "backgroundImage": "url('" + u + "')",
            "backgroundRepeat":"no-repeat",
            "backgroundSize": "cover"
        })
    })
})
